package cn.south.campus.admin.sys.controller;

import cn.south.campus.admin.sys.model.req.SysNoticeReq;
import cn.south.campus.admin.sys.model.vo.SysNoticeVo;
import cn.south.campus.admin.sys.service.SysNoticeService;
import cn.south.campus.common.model.bo.Result;
import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *
 * </p>
 *
 * @author chow
 * @since 2024/10/31 13:24
 */
@RestController
@RequestMapping("admin/sysNotice")
@AllArgsConstructor
public class SysNoticeController {

    private final SysNoticeService sysNoticeService;
    @PostMapping("/add")
    public Result<String> add(@RequestBody SysNoticeVo vo) {
        sysNoticeService.add(vo);
        return Result.success("添加成功");
    }

    @GetMapping("/page")
    public Result<IPage<SysNoticeVo>> sysNoticePage(@RequestParam SysNoticeReq req) {
        return Result.success(sysNoticeService.sysNoticePage(req));
    }
}
